package com.igrowing.easyRpc.registry;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class LocalRegistry {

    /**
     * 注册信息存储
     */
    private static final Map<String, Class<?>> map= new ConcurrentHashMap<>();

    public static void registry (String serviceName,Class<?> impClass)
    {
        map.put(serviceName,impClass);
    }


    /**
     * 获取服务
     * @param serviceName
     * @return
     */
    public static Class<?> get(String serviceName)
    {
        return map.get(serviceName);
    }

    /**
     * 删除服务
     * @param serviceName
     */
    public static void remove(String serviceName)
    {
        map.remove(serviceName);
    }


}
